#include"dimacsFile.h"
#include"bitMapGraph.h"
#include<stdio.h>

long n;
long m;
FILE *out, *file;
char* testeIn[100];
char* testeOut[100];

int numT = 15;
int main(){

testeIn[0]= "instance/anna.col";
testeOut[0] = "Result/anna2.col";
testeIn[1]= "instance/david.col";
testeOut[1] = "Result/david2.col";
testeIn[2]= "instance/games120.col";
testeOut[2] = "Result/games1202.col";
testeIn[3]= "instance/huck.col";
testeOut[3] = "Result/huck2.col";
testeIn[4]= "instance/myciel3.col";
testeOut[4] = "Result/myciel32.col";
testeIn[5]= "instance/myciel4.col";
testeOut[5] = "Result/myciel42.col";
testeIn[6]= "instance/myciel5.col";
testeOut[6] = "Result/myciel52.col";
testeIn[7]= "instance/myciel6.col";
testeOut[7] = "Result/myciel62.col";
testeIn[8]= "instance/myciel7.col";
testeOut[8] = "Result/myciel72.col";
testeIn[9]= "instance/queen5_5.col";
testeOut[9] = "Result/queen5_52.col";
testeIn[10]= "instance/queen6_6.col";
testeOut[10] = "Result/queen6_62.col";
testeIn[11]= "instance/anna.col";
testeOut[11] = "Result/annaOut.txt";
testeIn[12]= "instance/queen8_8.col";
testeOut[12] = "Result/queen8_82.col";
testeIn[13]= "instance/miles250.col";
testeOut[13] = "Result/miles2502.col";
testeIn[14]= "instance/queen9_9.col";
testeOut[14] = "Result/queen9_92.col";
testeIn[15]= "instance/miles500.col";
testeOut[15] = "Result/miles5002.col";

int f = 0;
for(f = 0; f <= numT; f++){
	file= fopen(testeIn[f], "r");
	int i,j;
	out= fopen(testeOut[f],"w");
	if(!readFile(file, graph, &n, &m)){
		fprintf(out,"p edge %d %d ", 2*n, 4*m);
		for(i = 0; i< n; i++){
			fprintf(out, "\ne %d %d", i+1, i+n+1);
			for(j = i+1; j< n; j++){
				if(hasEdge(i,j)){
					fprintf(out, "\ne %d %d", i+1, j+1);
					fprintf(out, "\ne %d %d", i+1, j+n+1);
					fprintf(out, "\ne %d %d", j+1, i+n+1);
					fprintf(out, "\ne %d %d", i+n+1, j+n+1);
				}
			}
		}	
		fclose(out);
		fclose(file);
	}
}
return 0;
}
